<template>
  <el-form
    ref="formInline"
    :inline="true"
    :model="formInline"
    label-width="80px"
    class="el-form--inline trainForm">
    <el-form-item
      label="培训类型"
      prop="trainType">
      <el-select
        v-model="formInline.trainType"
        placeholder="请选择">
        <el-option
          v-for="item in options"
          :key="item.value"
          :label="item.label"
          :value="item.value"/>
      </el-select>
    </el-form-item>
    <el-form-item
      label="原厂"
      prop="factory">
      <el-input
        v-model="formInline.factory"
        placeholder="请输入原厂"/>
    </el-form-item>
    <el-form-item
      label="经销商"
      prop="distributor">
      <el-input
        v-model="formInline.distributor"
        placeholder="请输入经销商"/>
    </el-form-item>
    <el-form-item
      label="培训结果"
      prop="trainResult">
      <el-select
        v-model="formInline.trainResult"
        placeholder="请选择">
        <el-option
          v-for="item in trainResultOptions"
          :key="item.value"
          :label="item.label"
          :value="item.value"/>
      </el-select>
    </el-form-item>
    <el-form-item
      label="通过时间"
      class="partnerDataPicker"
      prop="startTime">
      <el-date-picker
        v-model="formInline.startTime"
        type="date"
        placeholder="开始日期"/>
    </el-form-item>
    ~
    <el-form-item
      class="partnerDataPicker"
      prop="endTime">
      <el-date-picker
        v-model="formInline.endTime"
        type="date"
        placeholder="结束日期"/>
    </el-form-item>
    <el-form-item class="search-button-list">
      <el-button
        type="primary"
        @click="search">查询</el-button>
      <el-button
        type="default"
        @click="reset">重置</el-button>
    </el-form-item>
  </el-form>
</template>

<script>
export default {
  name: 'TrainForm',
  data () {
    return {
      formInline: {
        factory: '',
        distributor: '',
        trainType: '',
        trainResult: '',
        startTime: '',
        endTime: ''
      },
      options: [{
        value: '药品知识培训',
        label: '药品知识培训'
      }, {
        value: '政策知识培训',
        label: '政策知识培训'
      }],
      trainResultOptions: [{
        value: '通过',
        label: '通过'
      }, {
        value: '未通过',
        label: '未通过'
      }],
      value: ''
    }
  },
  methods: {
    search () {
      this.$emit('search')
    },
    reset () {
      this.$refs['formInline'].resetFields()
    }
  }
}
</script>

<style scoped lang="less">
</style>
